<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/jsplib/pubhead.jsp"%>
<%@ page import="net.comm.shequ.service.impl.ShequServiceImpl" %>
<%@ page import="net.comm.shequ.bean.BaseShequ" %>
<%@ page import="net.comm.shequ.web.form.ShequForm" %>
<%@ page import="net.comm.page.PageCtr" %>
<%@ page import="net.comm.common.ReturnMessage" %>
<%@ page import="java.util.List" %>

<% 
		try {
			request.setCharacterEncoding("UTF-8"); 
			response.setCharacterEncoding("UTF-8"); 
		} catch (Exception e) {
			e.printStackTrace();
		}
		//不缓存页面
		response.setHeader("Cache-Control","no-store");
		response.setHeader("Pragrma","no-cache");
		response.setDateHeader("Expires",0);

		String village = request.getParameter("village");
		int work_area = Integer.valueOf(request.getParameter("work_area"));
		village = new String(village.getBytes("iso-8859-1"),"utf-8");

		if(village == null || village.equals("")){
		
			village = "";
		}
		int ret = 0;

		StringBuffer sb = new StringBuffer(); 
		response.addHeader("Content-Type","text/html"); 
							
		if(!village.equals("")){
			ShequServiceImpl service = new ShequServiceImpl();

			//查询条件
			List list = service.listByVillage(village);
			if(list.size() > 0){

				BaseShequ base = new BaseShequ();
				base = (BaseShequ)list.get(0);
				if(base.getWork_area() != work_area){
					sb.append("社区不存在");
				}else{
					sb.append(base.getVillageID());
				}
			}else{
				sb.append("社区不存在");
			}
		}

//		System.out.println("s="+ sb.toString());

		response.getWriter().write(sb.toString()); 		
 %>       
